<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title>Title</title>
	</head>
	<body></body>
	<script src="../js/jquery-1.11.1.min.js"></script>
	<script src="../js/jquery-cookie-1.4.1.js"></script>
	<script src="../js/layer.js"></script>
	<script src="../js/vue-2.6.11.js"></script>
	<script src="../js/axios-0.19.2.min.js"></script>
	<script src="../js/jquery-cookie-1.4.1.js"></script>
	<script>
		new Vue({
			data: {},
			methods: {
				getWxLoginInfo() {
					axios.post("/getWxLoginInfo").then((response) => {
						if (response.data.flag) {
							$.cookie("userId", response.data.obj.userId, {
								path: "/",
								expires: 7
							})
							sessionStorage.setItem("loginUser", JSON.stringify(response.data.obj.loginUser))

							// 跳转到首页
							location.href = '/html/home.html';
						} else {
							layer.msg(response.data.message)
						}
					})
				}
			},
			created: function() {
				this.getWxLoginInfo();
			}
		})
	</script>

</html>
